<template>
  <div class="repor_list">
    <div
      class="rep_item"
      v-for="item in list"
      :key="item.id"
      @click="handNav(item)"
    >
      <div class="title">
        {{ item.title }}
      </div>
      <div class="time">
        {{ item.updateTime }}
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs } from "vue";
import { openUrl } from "@/utils/isOpenWebUrl";
import { useRouter } from "vue-router";

export default defineComponent({
  name: "NavBar",
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  setup() {
    const router = useRouter();
    const state = reactive({});
    const handNav = (item: any) => {
      openUrl(item, router);
    };
    return { ...toRefs(state), handNav };
  },
});
</script>
<style lang="scss" scoped>
.repor_list {
  .rep_item {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ededf2;
  }
  .title {
    @include ellipsisMultiline(2);
    font-size: 16px;
    color: #303030;
    font-weight: 600;
    margin-bottom: 20px;
  }
  .time {
    font-size: 12px;
    color: #9a9a9a;
  }
}
</style>
